
<html>

<head>
<title>图书馆管理系统</title>
<link href="/CSS/style.css" rel="stylesheet">
		<script language="javascript">
		function checkreader(){
			if(form.barcode.value==""){
				alert("请输入读者条形码!");form.barcode.focus();return;
			}
			form.submit();
		}
		function checkbook(form){
			if(form.barcode.value==""){
				alert("请输入读者条形码!");form.barcode.focus();return;
			}		
			if(form.inputkey.value==""){
				alert("请输入查询关键字!");form.inputkey.focus();return;
			}

			if(form.number.value-form.borrowNumber.value<=0){
				alert("您不能再借阅其他图书了!");return;
			}
			form.submit();
		}
		</script>
</head>
<body onLoad="clockon(bgclock)">



<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="118" valign="top" background="/Images/top_bg.gif" bgcolor="#EEEEEE"><table width="100%" height="33"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="81%" height="10"></td>
        <td colspan="2"></td>
      </tr>
      <tr>
        <td height="20">&nbsp;</td>
        <td width="10%"><a href="#" onClick="window.location.reload();" class="word_dark">刷新页面</a></td>
        <td width="9%"><a href="#" onClick="myclose()" class="word_dark">关闭系统</a></td>
		<script language="javascript">
			function myclose(){
				if(confirm("真的要关闭当前窗口吗?")){
					window.close();
				}
			}
		</script>
        </tr>
    </table>
      <table width="93%" height="79"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="69" align="right" valign="bottom">当前登录用户：${(Session.current_user.name)!}</td>
        </tr>
    </table></td>
  </tr>
</table>





<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="/JS/onclock.JS" charset="utf8"></script>
<script src="/JS/menu.JS" charset="utf8"></script>
<div class=menuskin id=popmenu
      onmouseover="clearhidemenu();highlightmenu(event,'on')"
      onmouseout="highlightmenu(event,'off');dynamichide(event)" style="Z-index:100;position:absolute;"></div>
<table width="778"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr bgcolor="#DFA40C">
        <td width="3%" height="27">&nbsp;</td>
        <td width="29%"><div id="bgclock" class="word_white"></div></td>
		<script language="javascript">
			function quit(){
				if(confirm("真的要退出系统吗?")){
					window.location.href="login.ftl";
				}
			}
		</script>
		<td width="66%" align="right" bgcolor="#B0690B" class="word_white"><a href="/index" class="word_white">首页</a> |
        <a  onmouseover=showmenu(event,sysmenu) onmouseout=delayhidemenu() class="word_white" style="CURSOR:hand" >系统设置</a> | <a  onmouseover=showmenu(event,readermenu) onmouseout=delayhidemenu() style="CURSOR:hand"  class="word_white">读者管理</a> | <a  onmouseover=showmenu(event,bookmenu) onmouseout=delayhidemenu() class="word_white" style="CURSOR:hand" >图书管理</a> | <a  onmouseover=showmenu(event,borrowmenu) onmouseout=delayhidemenu() class="word_white" style="CURSOR:hand">图书借还</a> | <a  onmouseover=showmenu(event,querymenu) onmouseout=delayhidemenu()  class="word_white" style="CURSOR:hand" >系统查询</a> | <a href="/send/pwd_Modify" class="word_white">更改口令</a> | <a href="#" onClick="quit()" class="word_white">退出系统</a></td>
        <td width="2%" bgcolor="#B0690B">&nbsp;</td>
  </tr>
      <tr bgcolor="#DFA40C">
        <td height="9" colspan="4" background="/Images/navigation_bg_bottom.gif"></td>
      </tr>
</table>

<table width="778"  border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td valign="top" bgcolor="#FFFFFF"><table width="100%" height="509"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableBorder_gray">
  <tr>
    <td height="27" valign="top" style="padding:5px;" class="word_orange">当前位置：图书借还 &gt; 图书借阅 &gt;&gt;&gt;</td>
  </tr>
  <tr>
    <td align="center" valign="top" style="padding:5px;"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
	<form name="form1" method="post" action="/borrow/reader_info">
      <tr>
        <td height="47" background="/Images/borrowBackRenew.gif">&nbsp;</td>
      </tr>
      <tr>
        <td height="72" align="center" valign="top" background="/Images/main_booksort_1.gif" bgcolor="#F8BF73"><table width="96%" border="0" cellpadding="1" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#F8BF73">
          <tr>
            <td valign="top" bgcolor="#F8BF73">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

				
                  <tr>
                    <td><table width="90%" height="21" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td width="24%" height="18" style="padding-left:7px;padding-top:7px;"><img src="/Images/reader_checkbg.jpg" width="142" height="18"></td>
                          <td width="76%" style="padding-top:7px;">读者条形码：
                            <input name="barcode" type="text" id="barcode" value="${(reader.barcode)!}" size="24">
                            &nbsp;
                            <input name="Button" type="submit" class="btn_grey" id="reader_info" value="确定" onClick="checkreader(form1)">${msg!}</td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="13" align="left" style="padding-left:7px;"><hr width="90%" size="1"></td>
                    </tr>
                  <tr>
                    <td align="center"><table width="96%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td height="27">姓&nbsp;&nbsp;&nbsp;&nbsp;名：
                            <input name="readername" type="text" id="readername" value="${(reader.name)!}"></td>
                          <td>性&nbsp;&nbsp;&nbsp;&nbsp;别：
                            <input name="sex" type="text" id="sex" value="${(reader.sex)!}"></td>
                          <td>读者类型：
                            <input name="readerType" type="text" id="readerType" value="${(reader.type)!}"></td>
                        </tr>
                        <tr>
                          <td height="27">证件类型：
                            <input name="paperType" type="text" id="paperType" value="${(reader.papertype)!}"></td>
                          <td>证件号码：
                            <input name="paperNo" type="text" id="paperNo" value="${(reader.paperno)!}"></td>
                          <td>可借数量：
                            <input name="number" type="text" id="number" value="${(reader.number)!}" size="17">
                            册
                            &nbsp;</td>
                        </tr>
                    </table></td>
                  </tr>
				 
              </table></td>
          </tr>
               <tr>
                 <td height="32" background="/Images/borrow_if.gif">&nbsp;添加的依据：
                     <form action="/borrow/list" method="get" id="form_list">
                   <input name="type" type="radio" class="noborder" value="barcode" checked>
                   图书条形码 &nbsp;&nbsp;
                   <input name="type" type="radio" class="noborder" value="name">
图书名称&nbsp;&nbsp;
<input name="value" type="text" id="inputkey" size="50">
                   <input name="Submit2" type="button" class="btn_grey" value="确定" id="submit2" onClick="checkbook(form1)">
  <input name="Button" type="button" class="btn_grey" value="完成借阅" id="finish">
                     </form>
                 </td>
               </tr> 
          <tr>
            <td valign="top" bgcolor="#FCEC9A" style="padding:5px"><table id="table_list" width="99%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#F6B83B" bgcolor="#FFFFFF">
                   <tr align="center" bgcolor="#F9D16B">
                     <td width="29%" height="25">图书名称</td>
                     <td width="12%">借阅时间</td>
                     <td width="14%">应还时间</td>
                     <td width="17%">出版社</td>
                     <td width="14%">书架</td>
                     <td colspan="2">定价(元)</td>
                   </tr>

 <input name="borrowNumber" type="hidden" id="borrowNumber" value="0">
                 </table>
			</td>
          </tr><font color="#adff2f"><h2 align="center">${suc!}</h2></font>
		 
        </table></td>
		 
      </tr>
      <tr>
        <td height="19" background="/Images/main_booksort_2.gif">&nbsp;</td>
      </tr>
	 </form>
    </table></td>
  </tr>
</table>
<table width="778" height="66"  border="0" align="center" cellpadding="-2" cellspacing="-2" bgcolor="#FFFFFF">
      <tr>
        <td height="11" colspan="4" background="/Images/copyright_t.gif"></td>
  </tr>
      <tr>
        <td width="124" height="23">&nbsp;</td>
        <td valign="bottom" align="center"> CopyRight &copy; 2008 www.**********.com 长春市*****有限公司</td>
        <td width="141">&nbsp;</td>
      </tr>
      <tr>
        <td height="23">&nbsp;</td>
        <td align="center">本站请使用IE6.0或以上版本 1024*768为最佳显示效果</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="8"></td>
        <td height="8"></td>
        <td height="8"></td>
      </tr>
</table>
</td>
  </tr>
</table>
<input type="hidden" value="${(reader.id)!}" id="reader_id">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="/My97DatePicker/WdatePicker.js"></script>
<script>
        $("#submit2").click(function () {
            var t=$('input[name="type"]:checked').val();
            var v=$("#inputkey").val();
            $.ajax({
                type:"get",
                url:"/borrow/list",
                data:{
                    "type":t,
                    "value":v
                },
                success:function (result) {
                    var table=$("#table_list")[0];
                    if(document.getElementById("trr")!=null){
                        table.removeChild(document.getElementById("trr"));
                    }
                    for(var i=0;i<result.length;i++){
                        var tr=document.createElement("tr");
                        tr.setAttribute("id","trr")
                        tr.setAttribute("bgcolor","F9D16B");
                        tr.setAttribute("align","center");

                        var td1=document.createElement("td");
                        var text1=document.createTextNode(result[i].name);
                        td1.appendChild(text1);
                        td1.setAttribute("height","25");

                        var td2=document.createElement("td");
                        var text2=document.createTextNode(result[i].borrowTime);
                        td2.appendChild(text2);

                        var td3=document.createElement("td");
                        var time=document.createElement("input");
                        time.setAttribute("readonly","readonly");
                        time.setAttribute("onfocus","WdatePicker()");
                        time.setAttribute("name","backTime");

                        td3.appendChild(time);

                        var td4=document.createElement("td");
                        var text4=document.createTextNode(result[i].publishing);
                        td4.appendChild(text4);

                        var td5=document.createElement("td");
                        var text5=document.createTextNode(result[i].bookcase);
                        td5.appendChild(text5);

                        var td6=document.createElement("td");
                        var text6=document.createTextNode(result[i].price);
                        td6.appendChild(text6);

                        var td7=document.createElement("td");
                        var input=document.createElement("input");
                        input.setAttribute("type","checkbox");
                        input.setAttribute("value",result[i].id);
                        input.setAttribute("name","checkbox");
                        td7.appendChild(input);

                        tr.appendChild(td1);
                        tr.appendChild(td2);
                        tr.appendChild(td3);
                        tr.appendChild(td4);
                        tr.appendChild(td5);
                        tr.appendChild(td6);
                        tr.appendChild(td7);
                        table.appendChild(tr);
                    }
                }
            });
        });

        $("#finish").click(function () {
            var nodes=document.getElementsByName("checkbox");
            var str="";
            //var time="";
            for(var i=0;i<nodes.length;i++){
                if(nodes[i].checked){
                    str=str+nodes[i].value+",";
                }
            }
            if(str==""){
                alert("您没有选择书籍");
                return;
            }
            /*if(time==""){
                alert("请选择归还时间");
                return;
            }*/
            location.href="/borrow/finish?readerId="+$("#reader_id").val()+"&bookIds="+str;
           /* $.ajax({
                type:"post",
                url:"/borrow/finish",
                data:{
                    "readerId":$("#reader_id").val(),
                    "bookIds":str
                }
            });*/
        });
</script>
</body>
</html>